Instructions for replicating article: Social Trust and the Winner-Loser Gap.

1. For each survey (Study 1 [Presidential Election] and Study 2 [Constitutional PLebiscite], open and run the code files in the following order (adjusting the route of each file separately): 
	a) Transformation to numeric.R
	b) Wide-Long Format.R
	c) Recodes.R
These files will prepare the datasets.
	
2. Run file 'Replication Code Winner Loser Gap and Social Trust.R' (within folder '3. Analysis Code') to obtain all results presented in the article and Online Supplement (sabe Figure 1 and 2). 
	a) This file will call source files that provide survey weights for complete and matched 		datasets for Study 1 and 2. 
	b) Only the routes of the 'Replication Code Winner Loser Gap and Social Trust.R' must be 		adjusted. 

3. To replicate Figure 1:
	a) Locate data file 'listado_encuestas_ic.Rdata' in a desired route. 
	b) Open and run file 'Replication Figure 1.R' and adjust the route.

3. To replicate Figure 2 run file 'Replication Figure 2.R.'

